package cn.jxau.qt.core.service.impl;

import java.util.List;

import cn.jxau.qt.core.dao.IBaseDao;
import cn.jxau.qt.core.factory.BasicFactory;
import cn.jxau.qt.core.service.IBaseService;

public class BaseServiceImpl<T> implements IBaseService<T> {

	@SuppressWarnings("unchecked")
	private IBaseDao<T> baseDao = BasicFactory.getFactory().getInstance(
			IBaseDao.class);

	@Override
	public void save(T t) {
		baseDao.save(t);
	}

	@Override
	public void update(T t) {
		baseDao.update(t);

	}

	@Override
	public void delete(int id) {
		baseDao.delete(id);

	}

	@Override
	public T findObjectById(int id) {
		return baseDao.findObjectById(id);
	}

	@Override
	public List<T> getAllObjects() {
		return baseDao.getAllObjects();
	}

}
